<!DOCTYPE html>
<!-- #set(List<TinyClass> clazzList) -->
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>课程预约</title>
<link draggable="true" rel="stylesheet" href="${viewPath}/resources/css/resv.css" />
<style type="text/css">
.resv-pad table tr td {
	cursor: pointer;
}
</style>
$!{include("import_js_css.html")}
<script type="text/javascript">
	var needConsumeQuery = true;
	var focusIntervalId;

	function documentReady() {

		initKcrqList();
		searchMemberList(null);
		$("#a_kcxx").click();
		getResultList(null);
		searchNowScheduleList();
		$("#txtMemberCode").focus();
		$("#gb").click(function() {
			$("#win").hide();
			$("#selectProduct2").hide();
		});
		$("#gbbut").click(function() {
			$("#win").hide();
			$("#selectProduct2").hide();
		});
		document.onkeydown = function(e) {
			var ev = document.all ? window.event : e;
			if (ev.keyCode == 13) {// 如（ev.ctrlKey && ev.keyCode==13）为ctrl+Center 触发
				var cardNumber = $("#txtMemberCode").val();
				ajaxGetMemberByCardNo(cardNumber);
			}
		}

		$("#selClazz").select2({
			width : "90%",
			minimumResultsForSearch : -1
		});
		$("#selClazz").change(function() {
			$("#scheduleList tr").remove();
			searchScheduleList(null);
			searchNowScheduleList();
		});

		$("#stat_info li").click(function() {
			var id = $(this).find("a").attr("id");
			if (id == "a_kcxx") {
				$("#scheduleList tr").remove();
				var date = $("#hidDate").val();
				getResultList(date);
			} else if (id == "a_jrkc") {
				//--今日课程列表
				getTodayResultList();
			} else if (id == "a_mrkc") {
				//--明日课程列表
				getTomorrowResultList();
			} else if (id == "a_hyxx") {
				searchMemberByCardNumber("");
			} else if(id == "a_zdhy") {//在店会员
				searchPresentMembers();
			} else if(id == "a_ldhy") {//离店会员
				searchAbsentMembers();
			} else if(id == "a_xfjl"){
				searchMemberConsume();
			}
		});

		setInterval(searchStaticMemberListByNo, 300000);

		//--每隔2秒刷新一次
		setInterval(freshStaticTab, 2000);
		focusIntervalId = setInterval(focusToInputMemberId,1000);

		function freshStaticTab() {
			var id = $("#stat_info .active a").attr("id");
			if (id == "a_kcxx") {
				var d = $("#hidDate").val();
				getStaticResultList(d);
			} else if (id == "a_jrkc") {
				getTodayStaticResultList();//--今日课程列表
			} else if (id == "a_mrkc") {
				getTomorrowStaticResultList();//--明日课程列表
			}
		}
		
		//点击会员查询
		$("#hybh").click(function(){
			var memberId = $(this).attr("data");
			needConsumeQuery = false;
			$("#a_xfjl").click();//不执行查询
			needConsumeQuery = true;
			searchMemberConsume(1,10,memberId);
		});
		
		//行选中变色
		$(".tab-content table.table-hover").on("click","tr td",function(){
			$(".tab-content .tab-tr-selected").removeClass("tab-tr-selected");
			var me = $(this);
			var tds = me.parent().children();
			tds.addClass("tab-tr-selected");
		});
		
		$("#operatorInfo table").on("click","tr td",function(){
			$("#operatorInfo .tab-tr-selected").removeClass("tab-tr-selected");
			var me = $(this);
			var tds = me.parent().children();
			tds.addClass("tab-tr-selected");
		});
		
		//拍摄头像
		var memberId = $("#hybh").attr("data");
		var swf = $("#pstx EMBED");
		swf.attr("flashvars",swf.attr("flashvars")+"&photoId="+memberId);
		
		$("#pstxBtn").click(function(){
			$("#pstx").css({
				"top":"50%",
				"left":"50%",
				"margin-left":"-257px",
				"margin-top":"-248px"
			}).show();
		});
		
		$("#inpstxBtn").click(function(){
			$("#pstx").css({
				"top":"50%",
				"left":"50%",
				"margin-left":"-257px",
				"margin-top":"-248px"
			}).show();
		});
		
		//选择头像
		$("#xztxBtn").click(function(){
			var memberId = $("#hybh").attr("data");
			$("#hidHeadImgMemberId").val(memberId);
			$("#fileUploadHeadImg").click();
		});
		
		$("#inxztxBtn").click(function(){
			var memberId = $("#hybh").attr("data");
			$("#hidHeadImgMemberId").val(memberId);
			$("#fileUploadHeadImg").click();
		});
		
		
		$("#closePstxDiv").click(function(){
			$("#pstx").hide();
		});
		
		$("#delayCardValidLimit").click(function(){
			var remainingId = $("#hidUniqueProductRemainingId").val();
			var memberId = $("#hybh").attr("data");
			
			if(memberId && productId){
				//弹出对话框，延迟几天
				$("#delayProductWin").show();
				$("#delayProductRemainingId").val(remainingId);
				clearInterval(focusIntervalId);
				 $("#delayProductDays").focus();
			}
		});
		
		$("#cancelDelayProduct").click(function(){
			$("#delayProductWin").hide();
			focusIntervalId = setInterval(focusToInputMemberId,1000);
		});
		
		$("#confirmDelayProduct").click(function(){
			var remainingId = $("#delayProductRemainingId").val();
			var delayDays = $("#delayProductDays").val();
			
			if(remainingId && delayDays){
				var url = "yueyogaAdmin/ajaxDelayProductValidDays.jhtml";
				$.post(url,{
					remainingId:remainingId,
					delayDays:delayDays
				},function(resp){
					var json = eval("("+resp+")");
					if(json.success){
						$("#delayProductWin").hide();
						focusIntervalId = setInterval(focusToInputMemberId,1000);
						alert("操作成功");
					}else {
						alert("操作失败，请输入正确的天数");
					}
				});
			}else {
				alert("必须先选中会员才能进行卡项延期操作");
			}
		});
	}
	
	function focusToInputMemberId(){
		$("#txtMemberCode").focus();
	}
	
	//上传头像
	function uploadHeadImg() {
		var form = $("#uploadHeadImgForm");
		var lefile = $("#fileUploadHeadImg").val();
		if (lefile != null && lefile != "") {
			form.submit();
		}
	}
	
	//更新会员头像
	function updateHeadImg(src) {
		var basePath = "${basePath}";
		$("#hytx").attr("src", basePath + src);
		$("#xhytx").attr("src",basePath + src);
	}
	
	/**
	 * 提供给FLASH的接口 ： 没有摄像头时的回调方法
	 */
	function noCamera() {
		alert("没有摄像头");
	}

	/**
	 * 提供给FLASH的接口：编辑头像保存成功后的回调方法
	 */
	function avatarSaved(data) {
		//这里需跳转到别的页面去
		$("#pstx").hide();
		var basePath = "${basePath}";
		
		var memberId = $("#hybh").attr("data");
		if(memberId){
			var url = "yueyogaAdmin/ajaxUpdateHeadImgByMemberId.jhtml";
			$.post(url,{
				memberId:memberId,
				headImgPath:data
			},function(resp){
				var json = eval("("+resp+")");
				if(json.success){
					$("#hytx").attr("src", basePath + data);
					$("#xhytx").attr("src",basePath + src);
				}
			});
		}
	}

	/**
	 * 提供给FLASH的接口：编辑头像保存失败的回调方法, msg 是失败信息，
	 * 可以不返回给用户, 仅作调试使用.
	 */
	function avatarError(msg) {
		alert(msg);
	}
	
	
	
	//查询会员消费记录
	function searchMemberConsume(pageNo,pageSize,memberId){
		var url = "yueyogaAdmin/ajaxGetConsumeList.jhtml";
		var intPageNo = pageNo || 1;
		var intPageSize = pageSize || 10;
		var paramMemberId = memberId || "";
		
		if(!needConsumeQuery){
			return;
		}
		
		$.post(url, {
			pageNo : intPageNo,
			pageSize : intPageSize,
			memberId : paramMemberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			var success = result.success;
			if (success) {
				$("#memberConsumeList tr:not(:eq(0))").remove();
				var totalPages = result.totalPages;
				var totalItems = result.totalItems;
				var pageNo = result.pageNo;
				var pageSize = result.pageSize;
				var prevPageNo = result.prevPageNo;
				var nextPageNo = result.nextPageNo;
				var items = result.items;//会员记录数组
				
				$.each(items, function(idx, item) {
					var info = "<tr><td>"+item.memberCardNo+"</td><td>"+item.memberName+"</td><td>"+item.className+"</td><td>"+item.week+" "+item.scheduleStartTime+"~"+item.scheduleEndTime+"</td><td>"+item.scheduleTeacherName+"</td><td>"+item.scheduleAssistantName+"</td><td>"+item.schedulePlaceName+"</td><td>"+item.productName+"</td><td>"+item.consumeTime+"</td></tr>";
					$("#memberConsumeList").append(info);
				});

				$(".memberConsumePageBar ul.pagination").initPageBar({
					pageNo : pageNo,
					pageSize : pageSize,
					prevPageNo : prevPageNo,
					nextPageNo : nextPageNo,
					totalPages : totalPages,
					totalResults : totalItems
				}, function(jumpTo, pageSize) {
					searchMemberConsume(jumpTo, pageSize,memberId);
				});
			} else {
				error("查询异常，请稍候再试，或联系管理员");
			}
		});
	}
	
	//查询在店会员
	function searchPresentMembers(pageNo,pageSize){
		var url = "yueyogaAdmin/ajaxGetPresentMembers.jhtml";
		var intPageNo = pageNo || 1;
		var intPageSize = pageSize || 10;

		$.post(url, {
			pageNo : intPageNo,
			pageSize : intPageSize
		}, function(resp) {
			var result = eval("(" + resp + ")");
			var success = result.success;
			if (success) {
				$("#presentMemberList tr:not(:eq(0))").remove();
				var totalPages = result.totalPages;
				var totalItems = result.totalItems;
				var pageNo = result.pageNo;
				var pageSize = result.pageSize;
				var prevPageNo = result.prevPageNo;
				var nextPageNo = result.nextPageNo;
				var items = result.items;//会员记录数组
				
				$.each(items, function(k, v) {
					var hybh = v.hybh || '';
					var hykh = v.hykh || '';
					var hyxm = v.hyxm || '';
					var kssj = v.kssj || '';
					var jssj = v.jssj || '';
					var hyzt = v.hyzt || '';
					var hyzzt = v.hyzzt || '';
					var cpcs = v.cplx || '';
					var lxdh = v.lxdh || '';
					var cpcs = v.cpcp || '';
					var cplx = v.cplx || '';
					var hjgw = v.hjgw || '';
					var sfgq = v.sfgq;
					var info = '<tr id="' + hybh + '" onclick="searchMemberDetail(' + hybh + ')" ' + ' ondblclick="searchPersonScheduleInfo(this.id,\'' + hyzzt + '\',\'' + sfgq + '\',\'' + cpcs + '\',\'' + cplx + '\')">' + '<td>' + hykh + '</td><td>' + hyxm + '</td><td>' + lxdh + '</td><td>' + hyzt + '</td> ' + '<td>' + hyzzt + '</td><td>' + hjgw + '</td><td>' + cplx + '</td><td>' + kssj + '</td>';
					if (sfgq) {
						info += '<td style="background:#FF6A6A;">' + jssj + '</td></tr> ';
					} else {
						info += '<td>' + jssj + '</td></tr> ';
					}
					$("#presentMemberList").append(info);
				});

				$(".presentMemberPageBar ul.pagination").initPageBar({
					pageNo : pageNo,
					pageSize : pageSize,
					prevPageNo : prevPageNo,
					nextPageNo : nextPageNo,
					totalPages : totalPages,
					totalResults : totalItems
				}, function(jumpTo, pageSize) {
					searchPresentMembers(jumpTo, pageSize);
				});
			} else {
				error("查询异常，请稍候再试，或联系管理员");
			}
		});
	}
	
	//查询离店会员
	function searchAbsentMembers(pageNo,pageSize){
		var url = "yueyogaAdmin/ajaxGetAbsentMembers.jhtml";
		var intPageNo = pageNo || 1;
		var intPageSize = pageSize || 10;

		$.post(url, {
			pageNo : intPageNo,
			pageSize : intPageSize
		}, function(resp) {
			var result = eval("(" + resp + ")");
			var success = result.success;
			if (success) {
				$("#absentMemberList tr:not(:eq(0))").remove();
				var totalPages = result.totalPages;
				var totalItems = result.totalItems;
				var pageNo = result.pageNo;
				var pageSize = result.pageSize;
				var prevPageNo = result.prevPageNo;
				var nextPageNo = result.nextPageNo;
				var items = result.items;//会员记录数组
				
				$.each(items, function(k, v) {
					var hybh = v.hybh || '';
					var hykh = v.hykh || '';
					var hyxm = v.hyxm || '';
					var kssj = v.kssj || '';
					var jssj = v.jssj || '';
					var hyzt = v.hyzt || '';
					var hyzzt = v.hyzzt || '';
					var cpcs = v.cplx || '';
					var lxdh = v.lxdh || '';
					var cpcs = v.cpcp || '';
					var cplx = v.cplx || '';
					var hjgw = v.hjgw || '';
					var sfgq = v.sfgq;
					var info = '<tr id="' + hybh + '" onclick="searchMemberDetail(' + hybh + ')" ' + ' ondblclick="searchPersonScheduleInfo(this.id,\'' + hyzzt + '\',\'' + sfgq + '\',\'' + cpcs + '\',\'' + cplx + '\')">' + '<td>' + hykh + '</td><td>' + hyxm + '</td><td>' + lxdh + '</td><td>' + hyzt + '</td> ' + '<td>' + hyzzt + '</td><td>' + hjgw + '</td><td>' + cplx + '</td><td>' + kssj + '</td>';
					if (sfgq) {
						info += '<td style="background:#FF6A6A;">' + jssj + '</td></tr> ';
					} else {
						info += '<td>' + jssj + '</td></tr> ';
					}
					$("#absentMemberList").append(info);
				});

				$(".absentMemberPageBar ul.pagination").initPageBar({
					pageNo : pageNo,
					pageSize : pageSize,
					prevPageNo : prevPageNo,
					nextPageNo : nextPageNo,
					totalPages : totalPages,
					totalResults : totalItems
				}, function(jumpTo, pageSize) {
					searchAbsentMembers(jumpTo, pageSize);
				});
			} else {
				error("查询异常，请稍候再试，或联系管理员");
			}
		});
	}

	//--正在进行的课程
	function searchNowScheduleList() {
		var clazzId = $("#selClazz").val();
		$("#scheduleNowList tr:not(:eq(0))").remove();
		var url = "yueyogaAdmin/ajaxGetNowScheduleList.jhtml";
		$.post(url, {
			clazzId : clazzId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var nowKc = '<tr><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || '') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.kczj || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + kc.cxrs + '</td></tr>';
					$("#scheduleNowList").append(nowKc);
				});
			}
		});
	}
	//--获取当前月份最大天数
	function maxDaysOfMonth(dm) {
		var d = new Date();
		if (dm) {
			return new Date(d.getFullYear(), dm, 0).getDate();
		}
		return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();
	}

	function getDaysInYearMonth(year, month) {
		var d = new Date();
		if (!year) {
			year = d.getFullYear();
		}
		if (!month) {
			month = d.getMonth() + 1;
		}
		month = parseInt(month, 10) + 1;
		var temp = new Date(year + "/" + month + "/0");
		var max_date = temp.getDate();
		return max_date;
	}

	//--根据日期获得课程信息
	function searchScheduleList(date) {
		$("#hidDate").val(date);
		$("#a_kcxx").click();
	}

	//--获取查询日期
	function getSearchDate(date) {
		if (!date) {
			var dt = new Date();
			var dm = dt.getMonth() + 1;
			var dd = dt.getDate();
			if (dd < 10) {
				dd = '0' + dd;
			}
			if (dm < 10) {
				dm = '0' + dm;
			}
			date = dm + '-' + dd;
		}
		return date;
	}
	//--根据日期获得课程查询结果
	function getResultList(date) {
		var clazzId = $("#selClazz").val();
		date = getSearchDate(date);
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		var rt = "";
		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trs = $("#scheduleList tr");
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;
					rt += '<tr key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
				});
				if (len > 10) {
					$("#scheduleListHeader").addClass("min-sche-header");
					$("#scheduleListHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListHeader").removeClass("min-sche-header");
					$("#scheduleListHeader").addClass("max-sche-header");
				}
				$("#scheduleList").append(rt);
			}
		});
	}

	var runingGetSchedule = false;
	//--根据日期获得课程查询结果--静态刷新
	function getStaticResultList(date) {
		var clazzId = $("#selClazz").val();
		date = getSearchDate(date);
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		var rt = "";

		if (runingGetSchedule) {
			return;
		}

		runingGetSchedule = true;

		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				var trs = $("#scheduleList tr");
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;
					var nrth = '<tr flag="' + flag + '" key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
					var tr = $("#scheduleList tr[key='" + key + "']");
					if (tr.length == 0) {
						$("#scheduleList").append(nrth);
					} else {
						tr.attr("flag", flag);
						tr.children().eq(2).html(kcmc);
						tr.children().eq(3).html((kc.kccd || ''));
						tr.children().eq(4).html((kc.kcls || ''));
						tr.children().eq(5).html((kc.kczj || ''));
						tr.children().eq(6).html(kc.ydzt);
						tr.children().eq(7).html(kc.hyrs);
						tr.children().eq(8).html(kc.cxrs);
						tr.children().eq(9).html(kc.qxrs);
						tr.children().eq(10).html(kc.zxws);
					}
				});
				$("#scheduleList tr:not([flag])").remove();
				$("#scheduleList tr").removeAttr("flag");

				if (len > 10) {
					$("#scheduleListHeader").addClass("min-sche-header");
					$("#scheduleListHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListHeader").removeClass("min-sche-header");
					$("#scheduleListHeader").addClass("max-sche-header");
				}
			}
			runingGetSchedule = false;
		});
	}

	//判断会员产品是否过期
	function productExpired(sfgq, prCount, prType) {
		if (sfgq == 'true') {
			$("#ksj").css("color", "red");
			$("#jsj").css("color", "red");
			$("#selectProduct2").show();
			$("#win").show();
			return true;
		}

		if (prCount) {
			var kk = prCount * 1;
			if (prType == '按次数' && kk <= 0) {
				$("#css").css("color", "red");
				$("#selectProduct2").show();
				$("#win").show();
				return true;
			}
		}
		return false;
	}

	//--获取tab页今日的课程信息
	function getTodayResultList() {
		var clazzId = $("#selClazz").val();
		//--今天日期
		var date = $("#btn_date").text();
		$("#scheduleTodayList tr").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				var rt = "";
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;
					rt += '<tr key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
				});
				if (len > 10) {
					$("#scheduleListTodayHeader").addClass("min-sche-header");
					$("#scheduleListTodayHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListTodayHeader").removeClass("min-sche-header");
					$("#scheduleListTodayHeader").addClass("max-sche-header");
				}
				$("#scheduleTodayList").append(rt);
			}
		});
	}

	var runingGetTodaySchedule = false;
	//--获取tab页今日的课程信息
	function getTodayStaticResultList() {
		var clazzId = $("#selClazz").val();
		//--今天日期
		var date = $("#btn_date").text();
		//$("#scheduleTodayList tr").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";

		if (runingGetTodaySchedule) {
			return;
		}
		runingGetTodaySchedule = true;

		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				var rt = "";
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;
					var nrth = '<tr flag="' + flag + '" key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
					var tr = $("#scheduleTodayList tr[key='" + key + "']");
					if (tr.length == 0) {
						$("#scheduleTodayList").append(nrth);
					} else {
						tr.attr("flag", flag);
						tr.children().eq(2).html(kcmc);
						tr.children().eq(3).html((kc.kccd || ''));
						tr.children().eq(4).html((kc.kcls || ''));
						tr.children().eq(5).html((kc.kczj || ''));
						tr.children().eq(6).html(kc.ydzt);
						tr.children().eq(7).html(kc.hyrs);
						tr.children().eq(8).html(kc.cxrs);
						tr.children().eq(9).html(kc.qxrs);
						tr.children().eq(10).html(kc.zxws);
					}
				});
				$("#scheduleTodayList tr:not([flag])").remove();
				$("#scheduleTodayList tr").removeAttr("flag");
				if (len > 10) {
					$("#scheduleListTodayHeader").addClass("min-sche-header");
					$("#scheduleListTodayHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListTodayHeader").removeClass("min-sche-header");
					$("#scheduleListTodayHeader").addClass("max-sche-header");
				}
			}
			runingGetTodaySchedule = false;
		});
	}

	//--获取tab页明日的课程信息
	function getTomorrowResultList() {
		var clazzId = $("#selClazz").val();
		//--明天日期
		var date = $("#btn_tdate").text();
		$("#scheduleTomorrowList tr").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		var rt = "";
		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;
					rt += '<tr key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
				});
				if (len > 10) {
					$("#scheduleListTomorrowHeader").addClass("min-sche-header");
					$("#scheduleListTomorrowHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListTomorrowHeader").removeClass("min-sche-header");
					$("#scheduleListTomorrowHeader").addClass("max-sche-header");
				}
				$("#scheduleTomorrowList").append(rt);
			}
		});
	}

	var runingGetTomorrowSchedule = false;
	//--获取tab页明日的课程信息
	function getTomorrowStaticResultList() {
		var clazzId = $("#selClazz").val();
		//--明天日期
		var date = $("#btn_tdate").text();
		//$("#scheduleTomorrowList tr").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		if (runingGetTomorrowSchedule) {
			return;
		}
		runingGetTomorrowSchedule = true;

		$.post(url, {
			clazzId : clazzId,
			kcrq : date
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				var len = data.length;
				var rt = "";
				$.each(data, function(key, kc) {
					var kcmc = (kc.kcmc || '');
					var flag = kc.kcbh + kc.kcrq.replace(/-/g, '') + kc.ksjs.replace(/ ~ /g, '').replace(/:/g, '');
					var key = flag + kc.kssj.replace(/:/g, '');
					var trId = "kctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh;

					var nrth = '<tr flag="' + flag + '" key="' + key + '" id="' + trId + '" onclick="searchSeatInfoList(this.id)"><td width="9%">' + kc.kcrq + '</td><td width="10%">' + kc.ksjs + '</td><td width="11%">' + kcmc + '</td><td width="15%">' + (kc.kccd || '') + '</td><td width="9%">' + (kc.kcls || '') + '</td><td width="9%">' + (kc.kczj || '') + '</td><td width="9%">' + (kc.ydzt || '') + '</td><td width="9%">' + (kc.hyrs || '0/0') + '</td><td width="6%">' + kc.cxrs + '</td><td width="6%">' + kc.qxrs + '</td><td width="9%">' + (kc.zxws || '0') + '</td></tr>';
					var tr = $("#scheduleTomorrowList tr[key='" + key + "']");
					if (tr.length == 0) {
						$("#scheduleTomorrowList").append(nrth);
					} else {
						tr.attr("flag", flag);
						tr.children().eq(2).html(kcmc);
						tr.children().eq(3).html((kc.kccd || ''));
						tr.children().eq(4).html((kc.kcls || ''));
						tr.children().eq(5).html((kc.kczj || ''));
						tr.children().eq(6).html(kc.ydzt);
						tr.children().eq(7).html(kc.hyrs);
						tr.children().eq(8).html(kc.cxrs);
						tr.children().eq(9).html(kc.qxrs);
						tr.children().eq(10).html(kc.zxws);
					}
				});
				$("#scheduleTomorrowList tr:not([flag])").remove();
				$("#scheduleTomorrowList tr").removeAttr("flag");
				if (len > 10) {
					$("#scheduleListTomorrowHeader").addClass("min-sche-header");
					$("#scheduleListTomorrowHeader").removeClass("max-sche-header");
				} else {
					$("#scheduleListTomorrowHeader").removeClass("min-sche-header");
					$("#scheduleListTomorrowHeader").addClass("max-sche-header");
				}
			}
			runingGetTomorrowSchedule = false;
		});
	}

	//--根据课程的序号，编号，日期，班级获取课程订座信息
	function searchSeatInfoList(id) {
		var ids = id.split('_');
		$("#td_kcmc").text("");
		$("#span_cxrs").text("");
		$("#span_hyrs").text("");
		$("#seatList tr").remove();
		if (ids && ids.length > 0) {
			if (!ids[1] || ids[1] == 'undefined') {
				return;
			}
			//--查询课程座位使用信息
			showReservationsList(ids[1], ids[3]);
		}
		var kcmc = $("#" + id).children().eq(2).text();
		var hyrs = $("#" + id).children().eq(7).text();
		var cxrs = $("#" + id).children().eq(8).text();
		$("#td_kcmc").text(kcmc);
		$("#span_cxrs").text(cxrs);
		$("#span_hyrs").text(hyrs);

	}

	//--根据trId查询课程预定信息
	function searchResvSeatInfo(trId) {
		var trIds = trId.split('_');
		$("#seatList tr").remove();
		if (trIds && trIds.length > 0) {
			showReservationsList(trIds[1], trIds[3]);
		}
		var cxrs = trIds[6];
		var hyrs = trIds[7];
		hyrs = hyrs.replace('X', '/');
		var kcmc = $("#hid_yd_kcmc").val();
		$("#td_kcmc").text(kcmc);
		$("#span_cxrs").text(cxrs);
		$("#span_hyrs").text(hyrs);

	}
	//--查看会员详情
	function searchMemberDetail(memberId) {
		var url = "yueyogaAdmin/ajaxGetMemberInfo.jhtml";
		$.post(url, {
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				if (data.hytx) {
					var hytx = "${basePath}" + data.hytx;
					$("#hytx").attr("src", hytx);
					$("#xhytx").attr("src", hytx);
					$("#gqhytx").attr("src", hytx);
				} else {
					var tx = "${resourcePath}/images/touXiang.jpg";
					$("#hytx").attr("src", tx);
					$("#xhytx").attr("src", tx);
					$("#gqhytx").attr("src", tx);
				}
				
				$("#hybh").attr("data",memberId);
				$("#hidUniqueProductRemainingId").val(data.prId);
				
				$("#hykh").text(data.hykh);
				$("#hyxm").text(data.hyxm);
				$("#hysjh").text(data.lxdh);
				$("#hykx").text(data.cpmc);
				$("#kssj").text(data.kssj);
				$("#jzsj").text(data.jssj);
				$("#hygw").text(data.hjgw);
				$("#hyzt").text(data.hyzt);
				$("#hyzzt").text(data.hyzzt);

				if (data.cplx == "按次数") {
					$("#hycs").text(data.cpcs);
				}else{
					$("#hycs").text("");
				}
				

				$("#xhykh").text(data.hykh);
				$("#xhyxm").text(data.hyxm);
				$("#xhysjh").text(data.lxdh);
				$("#xhykx").text(data.cpmc);
				$("#xkssj").text(data.kssj);
				$("#xjzsj").text(data.jssj);
				$("#xhygw").text(data.hjgw);
				$("#xhyzt").text(data.hyzt);
				$("#xhyzzt").text(data.hyzzt);

				$("#kh").text(data.hykh);
				$("#xm").text(data.hyxm);
				$("#sjh").text(data.lxdh);
				$("#kx").text(data.cpmc);
				$("#zt").text(data.hyzt);
				$("#zzt").text(data.hyzzt);
				$("#ksj").text(data.kssj);
				$("#jsj").text(data.jssj);
				$("#gww").text(data.hygw);
				if (data.cplx == "按次数") {
					$("#css").text(data.cpcs);
				}else{
					$("#css").text("");
				}
				var prId = data.prId;
				$("#hid_prId").val(prId);
			}
		});
	}

	function searchStaticMemberListByNo() {
		var id = $("#stat_info .active a").attr("id");
		if (id == "a_hyxx") {
			searchMemberByCardNumber("", 1, 10);
		}
	}
	//--查询会员列表
	function searchMemberList() {
		$("#a_hyxx").click();
	}
	function searchMemberByCardNo(cardNumber) {
		var cardNumber = $("#txtMemberCode").val();

		$("#a_hyxx").click();
	}

	var needAQuery = true;//是否需要一个查询
	function ajaxGetMemberByCardNo(cardNo,type) {
		var intPageNo = 1;
		var intPageSize = 10;
		var url = "yueyogaAdmin/ajaxGetMemberInfoList.jhtml";
		$.post(url, {
			pageNo : intPageNo,
			pageSize : intPageSize,
			cardNumber : cardNo
		}, function(resp) {
			var result = eval("(" + resp + ")");
			var success = result.success;
			if (success) {
				var items = result.items;
				if(items.length == 0){
					console.log("没有查找到会员");
				}else if (items.length == 1) {//仅有一个会员，则直接弹出
					var v = items[0];
					var hybh = v.hybh || '';
					var hykh = v.hykh || '';
					var hyxm = v.hyxm || '';
					var kssj = v.kssj || '';
					var jssj = v.jssj || '';
					var hyzt = v.hyzt || '';
					var hyzzt = v.hyzzt || '';
					var cpcs = v.cplx || '';
					var lxdh = v.lxdh || '';
					var cpcs = v.cpcp || '';
					var cplx = v.cplx || '';
					var hjgw = v.hjgw || '';
					var sfgq = v.sfgq;

					$(".td-mrt button").text(hykh + "  " + hyxm);
					$(".td-mrt button").val(hykh);
					searchMemberDetail(hybh);
					searchPersonScheduleInfo(hybh, hyzzt, ''+sfgq, cpcs, cplx);

					$("#txtMemberCode").val("");

				} else if (items.length > 1) {
					needAQuery = false;

					$("#a_hyxx").click();

					$("#memberList tr:not(:eq(0))").remove();
					var totalPages = result.totalPages;
					var totalItems = result.totalItems;
					var pageNo = result.pageNo;
					var pageSize = result.pageSize;
					var prevPageNo = result.prevPageNo;
					var nextPageNo = result.nextPageNo;

					$.each(items, function(k, v) {
						var hybh = v.hybh || '';
						var hykh = v.hykh || '';
						var hyxm = v.hyxm || '';
						var kssj = v.kssj || '';
						var jssj = v.jssj || '';
						var hyzt = v.hyzt || '';
						var hyzzt = v.hyzzt || '';
						var cpcs = v.cplx || '';
						var lxdh = v.lxdh || '';
						var cpcs = v.cpcp || '';
						var cplx = v.cplx || '';
						var hjgw = v.hjgw || '';
						var sfgq = v.sfgq;

						var info = '<tr id="' + hybh + '" onclick="searchMemberDetail(' + hybh + ')" ' + ' ondblclick="searchPersonScheduleInfo(this.id,\'' + hyzzt + '\',\'' + sfgq + '\',\'' + cpcs + '\',\'' + cplx + '\')">' + '<td>' + hykh + '</td><td>' + hyxm + '</td><td>' + lxdh + '</td><td>' + hyzt + '</td> ' + '<td>' + hyzzt + '</td><td>' + hjgw + '</td><td>' + cplx + '</td><td>' + kssj + '</td><td>' + jssj + '</td></tr> '
						$("#memberList").append(info);
					});

					$(".memberPageBar ul.pagination").initPageBar({
						pageNo : pageNo,
						pageSize : pageSize,
						prevPageNo : prevPageNo,
						nextPageNo : nextPageNo,
						totalPages : totalPages,
						totalResults : totalItems
					}, function(jumpTo, pageSize) {
						searchMemberByCardNumber(cardNo, jumpTo, pageSize);
					});

					needAQuery = true;
				}
			} else {
				error("查询失败!");
			}
		});
	}

	//--只用于查询会员列表
	function searchMemberByCardNumber(cardNumber, pageNo, pageSize) {
		var intPageNo = pageNo || 1;
		var intPageSize = pageSize || 10;
		var url = "yueyogaAdmin/ajaxGetMemberInfoList.jhtml";

		if (!needAQuery) {
			return;
		}

		$.post(url, {
			pageNo : intPageNo,
			pageSize : intPageSize,
			cardNumber : cardNumber
		}, function(resp) {
			var result = eval("(" + resp + ")");
			var success = result.success;
			if (success) {
				$("#memberList tr:not(:eq(0))").remove();
				var totalPages = result.totalPages;
				var totalItems = result.totalItems;
				var pageNo = result.pageNo;
				var pageSize = result.pageSize;
				var prevPageNo = result.prevPageNo;
				var nextPageNo = result.nextPageNo;
				var items = result.items;//会员记录数组
				$.each(items, function(k, v) {
					var hybh = v.hybh || '';
					var hykh = v.hykh || '';
					var hyxm = v.hyxm || '';
					var kssj = v.kssj || '';
					var jssj = v.jssj || '';
					var hyzt = v.hyzt || '';
					var hyzzt = v.hyzzt || '';
					var cpcs = v.cplx || '';
					var lxdh = v.lxdh || '';
					var cpcs = v.cpcp || '';
					var cplx = v.cplx || '';
					var hjgw = v.hjgw || '';
					var sfgq = v.sfgq;
					var info = '<tr id="' + hybh + '" onclick="searchMemberDetail(' + hybh + ')" ' + ' ondblclick="searchPersonScheduleInfo(this.id,\'' + hyzzt + '\',\'' + sfgq + '\',\'' + cpcs + '\',\'' + cplx + '\')">' + '<td>' + hykh + '</td><td>' + hyxm + '</td><td>' + lxdh + '</td><td>' + hyzt + '</td> ' + '<td>' + hyzzt + '</td><td>' + hjgw + '</td><td>' + cplx + '</td><td>' + kssj + '</td>';
					if (sfgq) {
						info += '<td style="background:#FF6A6A;">' + jssj + '</td></tr> ';
					} else {
						info += '<td>' + jssj + '</td></tr> ';
					}
					$("#memberList").append(info);
				});

				$(".memberPageBar ul.pagination").initPageBar({
					pageNo : pageNo,
					pageSize : pageSize,
					prevPageNo : prevPageNo,
					nextPageNo : nextPageNo,
					totalPages : totalPages,
					totalResults : totalItems
				}, function(jumpTo, pageSize) {
					searchMemberByCardNumber("", jumpTo, pageSize);
				});
				
				
				$("#seatTotalOfficialMembers").text(totalItems);
				
			} else {
				error("查询失败!");
			}
		});
		
		//查询会员总数
		var url = "yueyogaAdmin/ajaxGetTotalMembers.jhtml";
		$.post(url,{},function(resp){
			var result = eval("(" + resp + ")");
			$("#seatTotalMembers").text(result);
		});	
	}

	//--查询两周的日期
	function initKcrqList() {
		var dt = new Date();
		var date = dt.getDate();
		var dm = dt.getMonth() + 1;
		var limitDays = maxDaysOfMonth(dm);
		var tdate = date + 1;
		if (date < 10) {
			date = '0' + date;
		} else if (date > limitDays) {
			date = '01';
		}
		if (tdate < 10) {
			tdate = '0' + tdate;
		} else if (tdate > limitDays) {
			tdate = '01';
		}
		$("#kcrq_list table thead tr:not(:eq(0))").remove();
		$.post("yueyogaAdmin/ajaxGetTwoWeekDate.jhtml", function(resp) {
			var data = eval("(" + resp + ")");
			var str = '<tr>';
			$.each(data, function(i, val) {
				if (val == null || val.length <= 0) {

				} else {
					var d = val.split('-')[1];
					if (d == date) {
						str += '<td><button id="btn_date" class="resv-btn-week resv-btn-tt" onclick="searchScheduleList(\'' + val + '\')">' + val + '</button></td>';
					} else if (d == tdate) {
						str += '<td><button id="btn_tdate" class="resv-btn-week resv-btn-tt" onclick="searchScheduleList(\'' + val + '\')">' + val + '</button></td>';
					} else {
						str += '<td><button class="resv-btn-week" onclick="searchScheduleList(\'' + val + '\')">' + val + '</button></td>';
					}
					if (i == 6) {
						str += '</tr><tr>';
					}
				}
			});
			str += '</tr>';
			$("#kcrq_list table thead").append(str);
		});
	}

	function closeOperateInfo() {
		$("#operatorInfo").hide();
	}
	function showOperateInfo() {
		$("#operatorInfo").show();
	}

	//--查询课程座位使用信息
	function showReservationsList(kcxh, curDate) {
		$("#seatList tr").remove();
		var url = "yueyogaAdmin/ajaxGetReservations.jhtml";
		$.post(url, {
			curDate : curDate,
			ydId : kcxh
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				var items = data.items;
				var len = items.length;
				//填充表表格中
				var str = "<tr>";
				$.each(items, function(index, item) {
					var seat = item.seatNo;
					var memberId = item.memberId;
					var memberName = item.memberName;
					var id = item.id;
					if (memberId) {
						str += "<td id='yd_" + id + "' ondblclick='showMemberOperatePanel(\"" + memberId + "\")'";
						if (item.state == "是") {
							str += " class='schedule-td td-bg-green'>" + memberName + "</td>";
						} else {
							str += " class='schedule-td td-bg-blue'>" + memberName + "</td>";
						}
					} else {
						str += "<td id='yd_"+id+"' class='schedule-td'>" + seat + "</td>";
					}
					if ((index + 1) % 10 == 0) {
						str = str + "</tr><tr>";
					}
				});
				var kwNum = 10 - (len % 10);
				if (kwNum < 10) {
					for (var i = 0; i < kwNum; i++) {
						str = str + "<td>-</td>";
					}
				}
				str = str + "</tr>";
				$("#seatList").append(str);
			} else {
				error(data.msg || "查询失败!");
			}
		});
	}
	//--查询个人课程信息
	function searchPersonScheduleInfo(id, hyzzt, sfgq, prCount, prType) {
		if (hyzzt == '未开卡') {
			alert("该会员尚未开卡");
			return;
		} else {
			var r = productExpired(sfgq, prCount, prType);
			if(!r){
				showOperateInfo();
				$("#hidMemberId").val(id);
				searchTTScheduleList();
				searchPersonScheduleList();
				attendScheduleList();
			}
		}
	}

	function showMemberOperatePanel(memberId) {
		$("#hidMemberId").val(memberId);
		searchMemberDetail(memberId);
		showOperateInfo();
		searchTTScheduleList();
		searchPersonScheduleList();
		attendScheduleList();
	}
	//--今日日期
	function searchTodayScheduleList() {
		var clazzId = $("#selClazz").val();
		var memberId = $("#hidMemberId").val();
		//--今天日期
		var tdate = $("#btn_date").text();
		$("#jrscheduleList tr:not(:eq(0))").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		$.post(url, {
			clazzId : clazzId,
			kcrq : tdate,
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var trId = "jrkctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh + "_" + kc.ydbh;
					var jrkcTemp = kc.kcxh + "_" + kc.ksjs + "_" + kc.kcmc + "_" + (kc.kccd || '') + "_" + (kc.kcls || '') + "_" + (kc.kczj || '') + "_" + kc.ydzt + "_" + kc.hyrs;
					var jrkc = '';
					if (kc.ydzt == '预定结束') {
						jrkc = '<tr class="tr-ydjs"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || '') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.kczj || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + (kc.hyrs || '0/0') + '</tr>';
					} else {
						jrkc = '<tr id="' + trId + '" ondblclick="resvTodaySchedule(1,\'' + trId + '\',\'' + kc.kcxh + '\',\'' + jrkcTemp + '\')"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || '') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.kczj || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + (kc.hyrs || '0/0') + '</tr>';
					}
					$("#jrscheduleList").append(jrkc);
				});
			}
		});
	}

	//--获取明天课程
	function searchTomorrowScheduleList() {
		var clazzId = $("#selClazz").val();
		var memberId = $("#hidMemberId").val();
		//--明天日期
		var ttdate = $("#btn_tdate").text();
		$("#mrscheduleList tr:not(:eq(0))").remove();
		var url = "yueyogaAdmin/ajaxGetScheduleListByDate.jhtml";
		$.post(url, {
			clazzId : clazzId,
			kcrq : ttdate,
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var trId = "jrkctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh + "_" + kc.ydbh;
					var mrkcTemp = kc.kcxh + "_" + kc.ksjs + "_" + (kc.kcmc || '') + "_" + (kc.kccd || '') + "_" + (kc.kcls || '') + "_" + (kc.kczj || '') + "_" + (kc.ydzt || ' ') + "_" + (kc.hyrs || '0/0');
					var mrkc = '';
					if (kc.ydzt == '预定结束') {
						mrkc = '<tr class="tr-ydjs"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || ' ') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + (kc.hyrs || '0/0') + '</td></tr>';
					} else {
						mrkc = '<tr id="' + trId + '" ondblclick="resvTomorrowSchedule(2,\'' + trId + '\',\'' + kc.kcxh + '\',\'' + mrkcTemp + '\')"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || ' ') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + (kc.hyrs || '0/0') + '</td></tr>';
					}
					$("#mrscheduleList").append(mrkc);
				});
			}
		});
	}

	//--获取今天明天课程
	function searchTTScheduleList() {
		searchTodayScheduleList();
		searchTomorrowScheduleList();
	}

	//--获取今天的个人预定课程
	function searchPersonTodayScheduleList() {
		var clazzId = $("#selClazz").val();
		//--今天日期
		var tdate = $("#btn_date").text();
		var memberId = $("#hidMemberId").val();
		$("#jrydscheduleList tr:not(:eq(0))").remove();
		var url = "yueyogaAdmin/ajaxResvScheduleList.jhtml";
		$.post(url, {
			clazzId : clazzId,
			date : tdate,
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var hyrs = kc.hyrs;
					hyrs = hyrs.replace('X', '/');
					var trId = "qxjrkctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh + "_" + kc.ydbh + "_" + kc.cxrs + "_" + kc.hyrs;
					var yddbh = kc.ydbh;
					$("#hid_yd_kcmc").val(kc.kcmc || '');
					var jrkc = '<tr id="' + trId + '" onclick="selectSchedule(\'' + yddbh + '\',\'' + trId + '\')" ondblclick="cancelTodaySchedule(\'' + kc.kcxh + '\',\'' + trId + '\')"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || '') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (kc.kczj || '') + '</td><td>' + (kc.ydzt || '') + '</td><td>' + (hyrs || '0/0') + '</tr>';
					$("#jrydscheduleList").append(jrkc);
				});
			} else {
				error(result.items);
			}
		});
	}

	//--获取明天的个人预定课程
	function searchPersonTomorrowScheduleList() {
		var clazzId = $("#selClazz").val();
		//--明天日期
		var ttdate = $("#btn_tdate").text();
		var memberId = $("#hidMemberId").val();
		$("#mrydscheduleList tr:not(:eq(0))").remove();
		var url = "yueyogaAdmin/ajaxResvScheduleList.jhtml";
		$.post(url, {
			clazzId : clazzId,
			date : ttdate,
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var hyrs = kc.hyrs;
					hyrs = hyrs.replace('X', '/');
					$("#hid_yd_kcmc").val((kc.kcmc || ''));
					var trId = "qxjrkctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh + "_" + kc.ydbh;
					var mrkc = '<tr id="' + trId + '" ondblclick="cancelTomorrowSchedule(\'' + kc.kcxh + '\',\'' + trId + '\')"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || ' ') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td><td>' + (hyrs || '0/0') + '</td></tr>';
					$("#mrydscheduleList").append(mrkc);
				});
			} else {
				error(result.items);
			}
		});
	}

	//--获取今天，明天的个人预定课程
	function searchPersonScheduleList() {
		searchPersonTodayScheduleList();
		searchPersonTomorrowScheduleList();
	}

	//--取消今天的课程
	function cancelTodaySchedule(kcxh, trId) {
		var memberId = $("#hidMemberId").val();
		var url = "yueyogaAdmin/ajaxCancelSchedule.jhtml";
		$.post(url, {
			scheduleId : kcxh,
			memberId : memberId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				$("#" + trId).remove();
				var id = trId.substring(2, trId.length);
				var tval = $("#" + id + " td:last-child").text();
				var tvals = tval.split('/');
				var sl = tvals[0] * 1 - 1;
				$("#" + id + " td:last-child").text(sl + "/" + tvals[1]);
				//--冲刷新不合理。。。
				searchTodayScheduleList();
				/* var d = alert("取消成功!");
				setTimeout(function(){
					d.close().remove();
				},1000); */
			} else {
				error("取消预约失败!");
			}
		});
	}

	//--取消明天的课程
	function cancelTomorrowSchedule(kcxh, trId) {
		var memberId = $("#hidMemberId").val();
		var url = "yueyogaAdmin/ajaxCancelSchedule.jhtml";
		$.post(url, {
			scheduleId : kcxh,
			memberId : memberId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				$("#" + trId).remove();
				var id = trId.substring(2, trId.length);
				var tval = $("#" + id + " td:last-child").text();
				var tvals = tval.split('/');
				var sl = tvals[0] * 1 - 1;
				$("#" + id + " td:last-child").text(sl + "/" + tvals[1]);
				//--冲刷新不合理。。。
				searchTomorrowScheduleList();
				/* var d = alert("取消成功!");
				setTimeout(function(){
					d.close().remove();
				},1000); */
			} else {
				error("取消预约失败!");
			}
		});
	}

	//--预定课程
	function resvTodaySchedule(today, id, scheId, kctemp) {
		if (!scheId || scheId == 'undefined') {
			var d = alert("课程还未开启预定!");
			setTimeout(function() {
				d.close().remove();
			}, 900);
			return;
		}
		var cId = "#jrydscheduleList";
		var memberId = $("#hidMemberId").val();
		var url = "yueyogaAdmin/ajaxResvSchedule.jhtml";
		$.post(url, {
			scheId : scheId,
			memberId : memberId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				searchTodayScheduleList();
				searchPersonTodayScheduleList();
			} else {
				error(data.msg);
			}
		});
	}

	//--预定明天的课程
	function resvTomorrowSchedule(today, id, scheId, kctemp) {
		if (!scheId || scheId == 'undefined') {
			var d = alert("课程还未开启预定!");
			setTimeout(function() {
				d.close().remove();
			}, 900);
			return;
		}
		var cId = "#mrydscheduleList";
		var memberId = $("#hidMemberId").val();
		var url = "yueyogaAdmin/ajaxResvSchedule.jhtml";
		$.post(url, {
			scheId : scheId,
			memberId : memberId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				searchTomorrowScheduleList();
				searchPersonTomorrowScheduleList();
			} else {
				error(data.msg);
			}
		});
	}
	//--今日出席的课程
	function attendScheduleList() {
		var clazzId = $("#selClazz").val();
		$("#jrcxscheduleList tr:not(:eq(0))").remove();
		//--今天日期
		var tdate = $("#btn_date").text();
		var memberId = $("#hidMemberId").val();
		var url = "yueyogaAdmin/ajaxAttendScheduleList.jhtml";
		$.post(url, {
			clazzId : clazzId,
			date : tdate,
			memberId : memberId
		}, function(resp) {
			var result = eval("(" + resp + ")");
			if (result.success) {
				var data = eval("(" + result.items + ")");
				$.each(data, function(key, kc) {
					var trId = "cxjrkctr_" + kc.kcxh + "_" + kc.kcbh + "_" + kc.kcrq + "_" + kc.bjbh + "_" + kc.ydbh;
					var resvId = kc.ydbh;
					if (kc.kcxh) {
						var cxkc = '<tr id="' + trId + '" ondblclick="cancelAttendSchedule(' + resvId + ',\'' + trId + '\')"><td>' + kc.ksjs + '</td><td>' + (kc.kcmc || ' ') + '</td><td>' + (kc.kccd || '') + '</td><td>' + (kc.kcls || '') + '</td></tr>';
						$("#jrcxscheduleList").append(cxkc);
						var jrydkc = "qx" + trId.substring(2, trId.length);
						$("#" + jrydkc).remove();
					}
				});
			} else {
				error(result.items);
			}
		});
	}

	function selectSchedule(resvId, trId) {
		var prevId = $("#hidTrId").val();
		if (prevId) {
			$("#" + prevId).removeClass('select-tr');
		}
		$("#" + trId).addClass('select-tr');
	}

	//取消出席
	function cancelAttendSchedule(resvId, trId) {
		var url = "yueyogaAdmin/ajaxCancelAttendSchedule.jhtml";
		var trIds = trId.split('_');
		var prId = $("#hid_prId").val();
		$.post(url, {
			resvId : resvId,
			prId : prId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				$("#" + trId).remove();
				searchTodayScheduleList();
				searchScheduleList(null);
				searchNowScheduleList();
				if (trIds.length > 3) {
					showReservationsList(trIds[1], trIds[3]);
				}
				
				var memberId = $("#hidMemberId").val();
				searchMemberDetail(memberId);
				
			} else {
				error("取消出席失败!");
			}
		});
	}

	//出席课程
	function attendSchedule() {
		var trId = "";
		var trIds = "";
		var ydbh = "";
		var select_tr = $("#jrydscheduleList .select-tr");
		if (select_tr.length == 0) {
			var fisrt_tr = $("#jrydscheduleList tr:eq(1)");
			if (fisrt_tr.length == 0) {
				error("尚未预定课程无法出席!");
				return;
			} else {
				trId = fisrt_tr.attr("id");
				trIds = trId.split('_');
				ydbh = trIds[trIds.length - 3];
			}
		} else {
			trId = select_tr.attr("id");
			trIds = trId.split('_');
			ydbh = trIds[trIds.length - 3];
		}

		var url = "yueyogaAdmin/ajaxAttendSchedule.jhtml";
		var prId = $("#hid_prId").val();
		$.post(url, {
			resvId : ydbh,
			prId : prId
		}, function(resp) {
			var data = eval("(" + resp + ")");
			if (data.success) {
				var sd = $("#" + trId).children().eq(0).text();
				var kc = $("#" + trId).children().eq(1).text();
				var js = $("#" + trId).children().eq(2).text();
				var ls = $("#" + trId).children().eq(3).text();
				var zj = $("#" + trId).children().eq(4).text();
				var tbr = "<tr id='" + trId + "' ondblclick='cancelAttendSchedule(\"" + ydbh + "\",\"" + trId + "\")'><td>" + sd + "</td><td>" + kc + "</td><td>" + js + "</td><td>" + ls + "</td></tr>";
				$("#jrcxscheduleList").append(tbr);
				var jrydkc = "qx" + trId.substring(2, trId.length);
				$("#" + jrydkc).remove();
				getResultList(null);
				searchScheduleList(null);
				searchNowScheduleList();
				//--刷新底部信息
				searchResvSeatInfo(trId);
				
				var memberId = $("#hidMemberId").val();
				searchMemberDetail(memberId);
				
			} else {
				error(data.msg);
			}
		});
	}

	function closeDiv() {
		$("#operatorInfo").hide();
	}
</script>
</head>
<body>
	<form role="form" id="uploadHeadImgForm" target="upload" name="uploadImg"
		action="yueyogaAdmin/seatUpdateMemberHeadImg.jhtml" method="post"
		enctype="multipart/form-data">
		<input id="hidHeadImgMemberId" name="memberId" type="hidden" >
		<input id="fileUploadHeadImg" name="headImgPath" type="file" style="display: none;" onChange="uploadHeadImg()">
	</form>
	<iframe name="upload" id="upload" style="display: none"> </iframe>

	<div id="pstx" style="position:absolute;z-index:10000;width:516px;height:496px;display:none;border:1px solid #ccc;background-color:#fff;">
		<EMBED height="464" type="application/x-shockwave-flash"
			pluginspage="http://www.macromedia.com/go/getflashplayer" width="514"
			src="${assetsPath}/flash/AvatarEditor.swf" quality="high" allowscriptaccess="always"
			flashvars="type=camera&amp;postUrl=yueyogaAdmin/AvatarServlet?&amp;radom=1&amp;saveUrl=yueyogaAdmin/AvatarServlet?radom=1">
		</EMBED>
		<div style="height:26px;">
			<button id="closePstxDiv" style="float:right;">&nbsp;关闭&nbsp;</button>
		</div>
	</div>

	<div id="resv_all" class="col-lg-12 panel">
		<div class="row resv-main">
			<div id="mem_info" class="panel panel-default resv-member resv-pad" style="width: 14%; float: left;">
				<div class="panel-heading">会员信息</div>
				<div class="panel-body">
					<div class="resv-hyxx-tx">
						<img id="hytx" height="160px" width="125px" src="${viewPath}/resources/images/touXiang.jpg" />
					</div>
					<div class="resv-hyxx-r" style="margin-left:10px;">
						<button id="xztxBtn" style="height:24px;line-height:18px;">选择头像</button><button id="pstxBtn" style="height:24px;line-height:18px;">拍摄头像</button>
					</div>
					
					<div class="resv-hyxx-r">
						<label>卡号：</label><span id="hykh">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>姓名：</label><span id="hyxm">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>手机号：</label><span id="hysjh">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>卡项：</label><span id="hykx">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>状态：</label><span id="hyzt">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>子状态：</label><span id="hyzzt">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>开始时间：</label><span id="kssj">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>截止时间：</label><span id="jzsj">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>顾问：</label><span id="hygw">&nbsp;</span>
					</div>
					<div class="resv-hyxx-r">
						<label>次数：</label><span id="hycs">&nbsp;</span>
					</div>
					
					<div style="margin-top:20px;">
						<button id="hybh" class="btn btn-default">查看出勤</button>&nbsp;<button id="delayCardValidLimit" class="btn btn-default">卡项延期</button>
					</div>
					<input type="hidden" id="hidUniqueProductRemainingId" >
				</div>
			</div>
			<div class="resv-padr resv-schedule" style="width: 85%; float: right;">
				<div class="col-sm-6 resv-pad">
					<div class="panel panel-default">
						<div class="panel-heading">课程查询</div>
						<div id="kcrq_list" class="resv-schedule">
							<table class="table table-condensed rtb">
								<thead>
									<tr>
										<td>星期一</td>
										<td>星期二</td>
										<td>星期三</td>
										<td>星期四</td>
										<td>星期五</td>
										<td>星期六</td>
										<td>星期日</td>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td colspan="7" class="td-search">
											<div class="td-mlt">
												<select id="selClazz" class="selectpicker show-tick">
													<!-- #if(clazzList) -->
													<option value="">请选择班级</option>
													<!--#for(TinyClass clz : clazzList)-->
													<option value="${clz.classId}">${clz.className}</option>
													<!-- #end -->
													<!-- #end -->
												</select>
											</div>
											<div class="td-mcr">
												<input id="txtMemberCode" type="text" class="form-control" placeholder="会员卡号/卡外码/名称" />
											</div>
											<div class="td-mrt">
												<button class="btn btn-default" value="" onclick="ajaxGetMemberByCardNo(this.value)">卡号&nbsp;&nbsp;会员名</button>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="col-sm-6 resv-padr">
					<div class="panel panel-default">
						<div class="panel-heading">当前课程</div>
						<div id="panel_dqkc" class="panel-body resv-schedule">
							<div class="resv-tb-list">
								<table id="scheduleNowList" class="table table-bordered table-hover table-condensed tb rvtb">
									<tr>
										<td>时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
										<td>助教</td>
										<td>状态</td>
										<td>出席</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="resv-list resv-pad" style="width: 85%; float: right;">
				<div class="panel-body resv-pad">
					<div class="tabbable">
						<ul id="stat_info" class="nav nav-tabs">
							<li class="active"><a id="a_kcxx" href="#panel-kcxx" data-toggle="tab">课程信息</a></li>
							<li><a id="a_jrkc" href="#panel-jrkc" data-toggle="tab">今日课程</a></li>
							<li><a id="a_mrkc" href="#panel-mrkc" data-toggle="tab">明日课程</a></li>
							<li><a id="a_hyxx" href="#panel-hyxx" data-toggle="tab">会员信息</a></li>
							<li><a id="a_zdhy" href="#panel-zdhy" data-toggle="tab">在店会员</a></li>
							<li><a id="a_ldhy" href="#panel-ldhy" data-toggle="tab">离店会员</a></li>
							<li><a id="a_xfjl" href="#panel-xfjl" data-toggle="tab">出勤记录</a></li>
						</ul>
						<div class="tab-content">
							<!-- 课程信息 Tab -->
							<div class="tab-pane active" id="panel-kcxx">
								<table id="scheduleListHeader" class="table table-bordered table-condensed tb">
									<tr>
										<td width="9%">日期</td>
										<td width="10%">时段</td>
										<td width="11%">课程</td>
										<td width="15%">教室</td>
										<td width="9%">老师</td>
										<td width="9%">助教</td>
										<td width="9%">状态</td>
										<td width="9%">会员</td>
										<td width="6%">出席</td>
										<td width="6%">缺席</td>
										<td width="9%">总席位</td>
									</tr>
								</table>
								<div id="scheduleDIV" class="resv-schedule-list">
									<table id="scheduleList" class="table table-bordered table-hover table-condensed">
									</table>
								</div>
							</div>

							<!-- 今日课程 Tab -->
							<div class="tab-pane" id="panel-jrkc">
								<table id="scheduleListTodayHeader" class="table table-bordered table-condensed tb">
									<tr>
										<td width="9%">日期</td>
										<td width="10%">时段</td>
										<td width="11%">课程</td>
										<td width="15%">教室</td>
										<td width="9%">老师</td>
										<td width="9%">助教</td>
										<td width="9%">状态</td>
										<td width="9%">会员</td>
										<td width="6%">出席</td>
										<td width="6%">缺席</td>
										<td width="9%">总席位</td>
									</tr>
								</table>
								<div id="scheduleTodayDIV" class="resv-schedule-list">
									<table id="scheduleTodayList" class="table table-bordered table-hover table-condensed">
									</table>
								</div>
							</div>

							<!-- 明日课程 Tab -->
							<div class="tab-pane" id="panel-mrkc">
								<table id="scheduleListTomorrowHeader" class="table table-bordered table-condensed tb">
									<tr>
										<td width="9%">日期</td>
										<td width="10%">时段</td>
										<td width="11%">课程</td>
										<td width="15%">教室</td>
										<td width="9%">老师</td>
										<td width="9%">助教</td>
										<td width="9%">状态</td>
										<td width="9%">会员</td>
										<td width="6%">出席</td>
										<td width="6%">缺席</td>
										<td width="9%">总席位</td>
									</tr>
								</table>
								<div id="scheduleTomorrowDIV" class="resv-schedule-list">
									<table id="scheduleTomorrowList" class="table table-bordered table-hover table-condensed">
									</table>
								</div>
							</div>

							<!-- 会员信息 Tab -->
							<div class="tab-pane" id="panel-hyxx">
								<input type="hidden" id="hidDate" />
								<table id="memberList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td width="10%">卡号</td>
										<td width="11%">姓名</td>
										<td width="12%">电话</td>
										<td width="11%">状态</td>
										<td width="11%">子状态</td>
										<td width="11%">顾问</td>
										<td width="11%">卡种</td>
										<td width="11%">有效期(起始)</td>
										<td width="11%">有效期(截止)</td>
									</tr>
								</table>
								<div style="float:left;" class="memberPageBar">$!{include("page_bar.html")}</div>
								<div style="float:left;margin-left:20px;margin-top:5px;height:30px;line-height:30px;">
								本馆会员共&nbsp;<span id="seatTotalMembers"></span>&nbsp;人，其中正式会员&nbsp;<span id="seatTotalOfficialMembers"></span>&nbsp;人
								</div>
							</div>

							<!-- 在店会员 Tab -->
							<div class="tab-pane" id="panel-zdhy">
								<table id="presentMemberList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td width="10%">卡号</td>
										<td width="11%">姓名</td>
										<td width="12%">电话</td>
										<td width="11%">状态</td>
										<td width="11%">子状态</td>
										<td width="11%">顾问</td>
										<td width="11%">卡种</td>
										<td width="11%">有效期(起始)</td>
										<td width="11%">有效期(截止)</td>
									</tr>
								</table>
								<div class="presentMemberPageBar">$!{include("page_bar.html")}</div>
							</div>

							<!-- 离店会员 Tab -->
							<div class="tab-pane" id="panel-ldhy">
								<table id="absentMemberList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td width="10%">卡号</td>
										<td width="11%">姓名</td>
										<td width="12%">电话</td>
										<td width="11%">状态</td>
										<td width="11%">子状态</td>
										<td width="11%">顾问</td>
										<td width="11%">卡种</td>
										<td width="11%">有效期(起始)</td>
										<td width="11%">有效期(截止)</td>
									</tr>
								</table>
								<div class="absentMemberPageBar">$!{include("page_bar.html")}</div>
							</div>
							
							<!-- 消费记录 Tab -->
							<div class="tab-pane" id="panel-xfjl">
								<table id="memberConsumeList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td>卡号</td>
										<td>姓名</td>
										<td>班级</td>
										<td>课程时间</td>
										<td>老师</td>
										<td>助教</td>
										<td>场地</td>
										<td>产品</td>
										<td>上课时间</td>
									</tr>
								</table>
								<div class="memberConsumePageBar">$!{include("page_bar.html")}</div>
							</div>
							
							
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-12 panel panel-default resv-footer resv-pad">
				<table class="table table-bordered table-condensed tb">
					<tr>
						<td width="14%" id="td_kcmc">&nbsp;</td>
						<td class="td-seatList" rowspan="3">
							<div id="seatInfoList">
								<table id="seatList" class="table table-bordered table-condensed">
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
					<tr>
						<td id="td_cxrs">出席：<span id="span_cxrs">0</span></td>
					</tr>
					<tr>
						<td id="td_hyrs">会员：<span id="span_hyrs">0/0</span></td>
					</tr>
				</table>
			</div>
		</div>

		<input type="hidden" id="hid_yd_kcmc" /> <input type="hidden" id="hid_yd_cxrs" /> <input type="hidden" id="hid_yd_hyrs" />
		<!-- 会员操作弹出框 -->
		<div id="operatorInfo" class="panel panel-default" style="display: none;">
			<input type="hidden" id="hidMemberId" />
			<div class="panel-heading">
				会员操作
				<div class="op-close">
					<a href="javascript:closeOperateInfo()">×</a>
				</div>
			</div>
			<div class="panel-body resv-pad">

				<!-- 今日课程栏目 -->
				<div id="czjrkcList" class="resv-padlt" style="width: 40%; float: left;">
					<div class="panel panel-default">
						<div class="panel-heading">今日课程</div>
						<div class="panel-body">
							<div id="jrsykcList">
								<table id="jrscheduleList" class="table table-bordered table-condensed tb">
									<tr>
										<td>时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
										<td>助教</td>
										<td>状态</td>
										<td>会员</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!-- 明日课程栏目 -->
				<div id="czmrkcList" class="resv-padlr" style="width: 36%; float: left;">
					<div class="panel panel-default">
						<div class="panel-heading">明日课程</div>
						<div class="panel-body">
							<div id="mrsykcList">
								<table id="mrscheduleList" class="table table-bordered table-condensed tb">
									<tr>
										<td>时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
										<td>状态</td>
										<td>会员</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!-- 其他操作栏目 -->
				<div id="qtcz" class="resv-padrt" style="width: 24%; float: right;">
					<div class="panel panel-default">
						<div class="panel-heading">操作</div>
						<div class="panel-body">
							<div id="qtczInfo">
								<button onclick="attendSchedule()" style="width: 150px;" class="btn btn-default">出席</button>
								<button onclick="closeDiv()" class="btn btn-default ft-right">退出</button>
							</div>
						</div>
					</div>
					<div id="memberInfo">
						<div class="panel panel-default">
							<div class="panel-heading">会员信息</div>
							<div class="panel-body">
								<div>
									<div>
										<img id="xhytx" src="${resourcePath}/images/touXiang.jpg" style="height: 160px;width:125px;" />
										<div class="resv-pic-info ft-right">
											<div class="resv-hyxx-r">
												<label>卡号：</label><span id="xhykh"> </span>
											</div>
											<div class="resv-hyxx-r">
												<label>姓名：</label><span id="xhyxm"> </span>
											</div>
											<div class="resv-hyxx-r">
												<label>手机号：</label><span id="xhysjh"> </span>
											</div>
											<div class="resv-hyxx-r">
												<label>卡项：</label><span id="xhykx"> </span>
											</div>
											<div class="resv-hyxx-r">
												<label>顾问：</label><span id="xhygw"> </span>
											</div>
										</div>
									</div>
								</div>
								<div id="member_other_info">
									<div style="float:left;margin-left:5px;">
										<button id="inxztxBtn">选择头像</button><button id="inpstxBtn">拍摄头像</button>
									</div>
									<div class="resv-ot-info">
										<input type="hidden" id="hid_prId" />
										<div class="resv-hyxx-r">
											<label>状态：</label><span id="xhyzt"> </span>
										</div>
										<div class="resv-hyxx-r">
											<label>子状态：</label><span id="xhyzzt"> </span>
										</div>
										<div class="resv-hyxx-r">
											<label>开始时间：</label><span id="xkssj"> </span>
										</div>
										<div class="resv-hyxx-r">
											<label>截止时间：</label><span id="xjzsj"> </span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>


				<!-- 今日预定的课程栏目 -->
				<div id="jrydList" class="resv-padlt" style="width: 40%; float: left;">
					<div class="panel panel-default">
						<div class="panel-heading">今日预定课程</div>
						<div class="panel-body">
							<div id="jrydsykcList">
								<table id="jrydscheduleList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td>时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
										<td>助教</td>
										<td>状态</td>
										<td>会员</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!-- 明日预定的课程栏目 -->
				<div id="mrydList" class="resv-padlr" style="width: 36%; float: left;">
					<div class="panel panel-default">
						<div class="panel-heading">明日预定课程</div>
						<div class="panel-body">
							<div id="mrydsykcList">
								<table id="mrydscheduleList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td>时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
										<td>会员</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!-- 今日出席的课程-->
				<div id="jrcxList" class="resv-padrt" style="width: 24%; float: right;">
					<div class="panel panel-default">
						<div class="panel-heading">今日出席</div>
						<div class="panel-body">
							<div id="jrcxkcList">
								<table id="jrcxscheduleList" class="table table-bordered table-hover table-condensed tb">
									<tr>
										<td style="width: 90px">时段</td>
										<td>课程</td>
										<td>教室</td>
										<td>老师</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 产品到期提示 -->
	<div id="selectProduct2" style="display: none; position: absolute; left: 0; top: 0; width: 100%; height: 180%; background-color: black; filter: alpha(opacity = 70); -moz-opacity: 0.7; opacity: 0.7;"></div>
	<div id="win" style="display: none; POSITION: absolute; left: 50%; top: 50%; width: 600px; height: 240px; margin-left: -300px; margin-top: -200px; border: 1px solid #888; background-color: #fff;">
		<div style="height: 30px; background: #ddd; padding: 5px;">
			过期提醒
			<div id="gb" style="padding: 5px 10px; margin: -4px -10px 0px 0px; float: right; cursor: pointer;">×</div>
		</div>
		<div class="panel-hyxq">
			<div style="margin-top: 5px; margin-left: 5px; float: left;">
				<div>
					<img id="gqhytx" height="160px" width="125px" src="${resourcePath}/images/touXiang.jpg">
				</div>
			</div>
			<div class="div-hyxx">
				<div class="div-hyxx-part">
					<span class="span-hyxq">卡号:</span><span id="kh"></span>
				</div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">姓名:</span><span id="xm"></span>
				</div>
				<div class="clear"></div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">手机号:</span><span id="sjh"></span>
				</div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">卡项:</span><span id="kx"></span>
				</div>
				<div class="clear"></div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">状态:</span><span id="zt"></span>
				</div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">子状态:</span><span id="zzt"></span>
				</div>
				<div class="clear"></div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">开始时间:</span><span id="ksj"></span>
				</div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">截止时间:</span><span id="jsj"></span>
				</div>
				<div class="clear"></div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">顾问:</span><span id="gww"></span>
				</div>
				<div class="div-hyxx-part">
					<span class="span-hyxq">次数:</span><span id="css"></span>
				</div>
				<div class="clear"></div>
			</div>
			<div>
				<input type="button" id="gbbut" value="关闭" class="btn btn-default" style="margin-right: 10px; float: right; border-radius: 4px; background-color: #FFF; border-color: #CCC; vertical-align: middle;" />
			</div>
		</div>
	</div>
	
	<!-- 产品延期 -->
	<div id="delayProductWin" style="position:absolute;left:50%;top:50%;width:300px;height:170px;margin-top:-85px;margin-left:-150px;background-color:#fff;display:none;border:1px solid #ddd;">
		<div class="header" style="border-bottom:1px solid #ddd;font-weight:bold;height:30px;line-height:30px;">&nbsp;&nbsp;卡项延期设置</div>
		<div style="margin-top:10px;margin-left:20px;">
			<label for="delayProductDays">延期天数：</label><input type="text" id="delayProductDays" style="width:60px;">
			<input type="hidden" id="delayProductRemainingId" ><input type="hidden" id="delayMemberId" >
		</div>
		<div style="margin-top:50px;text-align:right;">
			<button id="confirmDelayProduct" class="btn btn-default">确定</button><button id="cancelDelayProduct" class="btn btn-default" style="margin-left:5px;margin-right:10px;">取消</button>
		</div>
	</div>
	
</body>
</html>